package com.zzptc.myapp8;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.lang.reflect.Array;

public class Main2Activity extends AppCompatActivity {
    String[] s={"aaa","bbb","ccc"};
    ListView lv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        lv=findViewById(R.id.lv);
        //new ArrayAdapter<String>()
       ArrayAdapter<String>adapter=
               new ArrayAdapter(Main2Activity.this, android.R.layout.activity_list_item,
                s);
        lv.setAdapter(adapter);

    }
}
